/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gestionnaires;

import java.util.Collection;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import modeles.Acteur;
import modeles.Note;

/**
 *
 * @author mazid
 */
@Stateless
public class GestionNote {
    @PersistenceContext(unitName = "Projet-WebPU")
    private EntityManager em;

    public void persist(Object object) {
        em.persist(object);
    }

     /*
    * affiche la liste de toutes les notes
    */
    public Collection<Note> getAllNote() {
         Query q = em.createQuery("select n from Note n");  
        return (Collection<Note>)q.getResultList();  
    }
    
    
    /* supprimer une note dansla liste des notes
    * 
    */
    public void supprimerGenre(Collection<Note> notes){
        this.em.remove(notes);
        
     }
}
